package com.ws.admin.post.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import com.ws.admin.post.entity.Post;
import org.springframework.web.bind.annotation.RestController;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ws.common.result.entity.ResultEntity;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import com.ws.admin.post.service.IPostService;
import com.ws.common.base.BaseController;

/**
 * <p>
 * 论坛-帖子 前端控制器
 * </p>
 *
 * @author weifucheng
 * @since 2019-11-26
 */
@RestController
@RequestMapping("/post")
public class PostController extends BaseController<Post> {

    @Autowired
    private IPostService postService;

    @RequestMapping("/list")
    public ResultEntity list(Post post, Integer current, Integer size){
        return ResultEntity.succes(postService.list(post, current, size));
    }

    @RequestMapping("/readPostAndReply")
    public ResultEntity readPostAndReply(Post post){
        Map<String,Object> map=postService.readPostAndReply(post);
        return ResultEntity.succes(map);
    }

}
